package cn.kgc.spring03.controller;

import cn.kgc.spring03.service.UserService;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/4/27
 * @Description:
 */
@Controller
public class UserController {

    //@Autowired   //  1.byType   2. byName
    //@Qualifier("userService2")
    @Resource(name = "userService2")     //  byName    byType
    private UserService userService3;

    //@Autowired
    //public void setUserService(@Qualifier("userService") UserService userService3) {
    //    System.out.println("===========================");
    //    this.userService = userService3;
    //}

    public String method1(){
        System.out.println("UserController method1() ");
       String info =  userService3.method1();
       return info;
    }

}
